﻿#include "ZShellDesktopViewer.h"
#include <QtCore>
#include <QtWidgets>

int main(int argc, char *argv[]) {
    if (argc == 1) {
        return  1;
    }

    char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
    char ARG_DISABLE_SAND_BOX[] = "--no-sandbox";
    int newArgc = argc+2+1;
    char** newArgv = new char*[newArgc];
    for (int i=0; i<argc; i++) {
        newArgv[i] = argv[i];
    }
    newArgv[argc] = ARG_DISABLE_WEB_SECURITY;
    newArgv[argc + 1] = ARG_DISABLE_SAND_BOX;

    newArgv[argc + 2] = nullptr;

    QApplication a(newArgc, newArgv);

    //如果不是3d渲染会出现, 透明的地方不能点击., 并且会导致窗口在屏幕位置的偏移
    QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);

    ZShellDesktopViewer viewer;
    Q_UNUSED(viewer);

    return a.exec();
}
